# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DisplayVideo.V3.Model.CustomBiddingScript do
  @moduledoc """
  A single custom bidding script.

  ## Attributes

  *   `active` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the script is currently being used for scoring by the parent algorithm.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the script was created.
  *   `customBiddingAlgorithmId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the custom bidding algorithm the script belongs to.
  *   `customBiddingScriptId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the custom bidding script.
  *   `errors` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.ScriptError.t)`, *default:* `nil`) - Output only. Error details of a rejected custom bidding script. This field will only be populated when state is REJECTED.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the custom bidding script.
  *   `script` (*type:* `GoogleApi.DisplayVideo.V3.Model.CustomBiddingScriptRef.t`, *default:* `nil`) - The reference to the uploaded script file.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the custom bidding script.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :active => boolean() | nil,
          :createTime => DateTime.t() | nil,
          :customBiddingAlgorithmId => String.t() | nil,
          :customBiddingScriptId => String.t() | nil,
          :errors => list(GoogleApi.DisplayVideo.V3.Model.ScriptError.t()) | nil,
          :name => String.t() | nil,
          :script => GoogleApi.DisplayVideo.V3.Model.CustomBiddingScriptRef.t() | nil,
          :state => String.t() | nil
        }

  field(:active)
  field(:createTime, as: DateTime)
  field(:customBiddingAlgorithmId)
  field(:customBiddingScriptId)
  field(:errors, as: GoogleApi.DisplayVideo.V3.Model.ScriptError, type: :list)
  field(:name)
  field(:script, as: GoogleApi.DisplayVideo.V3.Model.CustomBiddingScriptRef)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.DisplayVideo.V3.Model.CustomBiddingScript do
  def decode(value, options) do
    GoogleApi.DisplayVideo.V3.Model.CustomBiddingScript.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DisplayVideo.V3.Model.CustomBiddingScript do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
